<?php
namespace Common\Model;   
/**
* 优惠券
* @date: 2018年3月20日 上午9:51:38
* @author: liuyang
*/
class  CouponModel extends BaseModel {
       
    /**
     * 单个信息
     * @param unknown $id
     * @return \Think\mixed
     */
    public function get($id){
        $where =array();
        $where['id']=$id;
        $options =array();
        $options['field']="id,name,subtitle,pic,startdate,enddate,description,type";
        $obj =  $this->where($where)->find($options);
        if($obj['id']>0){
            $obj['startdate']=date("Y-m-d",$obj['startdate']);
            $obj['enddate']=date("Y-m-d",$obj['enddate']);
        }
        return $obj;
    }

}